#include <iostream>
#include <cstring>
#include "SharedMemory.hpp"
#include "Time.hpp"
#include "Fifo.hpp"

int main()
{
    shm.CreateShm();
    shm.AttachShm();
    gpipe.OpenPipeForWrite();
    // 在这里进行 IPC
    struct data *image = (struct data *)shm.GetAddr();
    // printf("client 的虚拟地址： %p\n", strinfo);
    char ch = 'A';
    while(ch <= 'Z')
    {
        strcpy(image->status, "最新");
        strcpy(image->lasttime, GetCurrTime().c_str());
        strcpy(image->image, "xxxxxxxxxxxxxxxxxxxx");

        // 写完通知它读
        gpipe.Signal();
        sleep(3);
    }
    
    shm.DetachShm();
    return 0;
}